#ifndef PolarAlign_H
#define PolarAlign_H

#include <qmainwindow.h>
#include <qdialog.h>
#include <QMetaType>

#include <baseclient.h>
#include <basedevice.h>
#include <indicom.h>
#include <libnova.h>
#include <math.h>

#include "Catalog.h"
#include "TwoStarWizard.h"
#include "StarSelect.h"
#include <HandController.h>

Q_DECLARE_METATYPE(INDI::BaseDevice *);
Q_DECLARE_METATYPE(INDI::Property *);

namespace Ui
{
class PolarAlign;
class Servers;
}

class PolarAlign : public QMainWindow
{
Q_OBJECT
public:
  PolarAlign();
  //virtual ~PolarAlign();
    
  
public slots:
  bool connectServer();
  bool disconnectServer();
  bool connectMountDevice();
  bool disconnectMountDevice();   
  void changeObserver(double lng, double lat);
  
  void newDevice(INDI::BaseDevice *dp);
  void newProperty(INDI::Property *property);
  void removeProperty(INDI::Property *property);
  void newBLOB(IBLOB *bp);
  void newSwitch(ISwitchVectorProperty *svp);
  void newNumber(INumberVectorProperty *nvp);
  void newMessage(INDI::BaseDevice *dp, int messageID);
  void newText(ITextVectorProperty *tvp);
  void newLight(ILightVectorProperty *lvp);
  void serverConnected();
  void serverDisconnected(int exit_code); 
  
private:  
  Ui::PolarAlign* ui;
  Ui::Servers *uiservers;
  //Ui::MountDisplay *uimountdisplay;
  HandController *hc;
  QDialog dialogServer;
  INDI::BaseDevice *mountdevice;
  bool mountwasconnected;
  double obs_lon, obs_lat, obs_lst;
  double currentRA, currentDEC, currentAlt, currentAz;
  Catalog *cat;
  TwoStarWizard *tswizard;
  StarSelect *starpairs;
};

#endif // PolarAlign_H
